package com.me.mvc.model.entity;

import java.util.Date;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * Created by roman on 22.03.15.
 */
@XmlRootElement(name = "transaction")
public class Transaction {

    private int id;

    private Account senderAccount;

    private Account receiverAccount;

    private Double sum;

    private Date dateOfTransaction;

    public Transaction(int id, Account senderAccount, Account receiverAccount, Double sum, Date dateOfTransaction) {
        this.id = id;
        this.senderAccount = senderAccount;
        this.receiverAccount = receiverAccount;
        this.sum = sum;
        this.dateOfTransaction = dateOfTransaction;
    }

    public Transaction() {
    }

    @XmlElement(name = "id")
    public int getId() {
        return id;
    }

    public void setId(final int id) {
        this.id = id;
    }

    @XmlElement(name = "senderAccountId")
    public Account getSenderAccount() {
        return senderAccount;
    }

    public void setSenderAccount(final Account senderAccount) {
        this.senderAccount = senderAccount;
    }

    @XmlElement
    public Account getReceiverAccount() {
        return receiverAccount;
    }

    public void setReceiverAccount(final Account receiverAccount) {
        this.receiverAccount = receiverAccount;
    }

    @XmlElement
    public Double getSum() {
        return sum;
    }

    public void setSum(final Double sum) {
        this.sum = sum;
    }

    @XmlElement
    public Date getDateOfTransaction() {
        return dateOfTransaction;
    }

    public void setDateOfTransaction(final Date dateOfTransaction) {
        this.dateOfTransaction = dateOfTransaction;
    }
}
